<template>
    <div style="padding: 20px;">
      <div class="headerBoxList">
          <svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="4" y="34" width="8" height="8" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><rect x="8" y="6" width="32" height="12" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M24 34V18" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M8 34V26H40V34" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><rect x="36" y="34" width="8" height="8" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><rect x="20" y="34" width="8" height="8" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M14 12H16" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>
          <span style="margin-left: 10px">网络地址 <span style="font-size: 15px;" v-if="total!==0">({{ total }}行)</span></span>
        </div>
        <div class="content">
      
          <p style="border-bottom: 1px solid #ebebeb;" v-for="(item,index) in list" :key="index" v-html="item.replace(/\s/g, '&nbsp;')"></p>
          <!-- <p v-html="str"></p> -->
          <!-- <pre style="border-bottom: 1px solid #ebebeb;" v-for="(item,index) in list" :key="index">{{ item }}</pre> -->
        </div>
    </div>
  </template>
  
  <script>
  export default {
      name:'networkAddress',
      data(){
          return{
              list:[],
              total:0,
          }
      },
      mounted(){
          this.init();
      },
      methods:{
      init(){
          let str = `lo        Link encap:UNSPEC
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope: Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:5107 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5107 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:12655929 TX bytes:12655929

dummy0    Link encap:UNSPEC
          inet6 addr: fe80::a0d0:fbff:fed4:4a/64 Scope: Link
          UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:74 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 TX bytes:5180

p2p0      Link encap:UNSPEC    Driver icnss2
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3000
          RX bytes:0 TX bytes:0

rmnet_data2 Link encap:UNSPEC
          inet6 addr: 2408:851a:20:19f5:5002:20ff:fe34:c835/64 Scope: Global
          inet6 addr: fe80::5002:20ff:fe34:c835/64 Scope: Link
          UP RUNNING  MTU:1432  Metric:1
          RX packets:122 errors:0 dropped:0 overruns:0 frame:0
          TX packets:89 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:11472 TX bytes:6956

rmnet_ipa0 Link encap:UNSPEC
          UP RUNNING  MTU:9216  Metric:1
          RX packets:336 errors:0 dropped:0 overruns:0 frame:0
          TX packets:743 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:35600 TX bytes:35892

rmnet_data0 Link encap:UNSPEC
          inet6 addr: fe80::30b4:8fff:fef9:52ef/64 Scope: Link
          UP RUNNING  MTU:1500  Metric:1
          RX packets:123 errors:0 dropped:0 overruns:0 frame:0
          TX packets:103 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7404 TX bytes:6328

wlan0     Link encap:UNSPEC    Driver icnss2
          inet addr:192.168.1.111  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::ae3:57a6:29dc:aa23/64 Scope: Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3042434 errors:0 dropped:0 overruns:0 frame:0
          TX packets:618426 errors:0 dropped:16 overruns:0 carrier:0
          collisions:0 txqueuelen:3000
          RX bytes:4264131720 TX bytes:83649294`
          let arr = str.split("\n");
          console.log(arr)
          this.list = arr;
          this.total = arr.length;
      }
  
      }
  
  }
  </script>
  
  <style scoped>
      .headerBoxList {
      width: 100%;
      height: 50px;
      border-bottom: 1px solid #d2d2d2;
      display: flex;
      align-items: center;
      font-size: 18px;
      font-weight: bold;
    }
    .content{
      height: 80vh;
      overflow-y: auto;
      padding-left:50px;
      margin-top: 20px;
  }
    @media screen and (min-width: 2360px) {
      .content{
      height:67vh;
      overflow-y: auto;
  
    }
    }
  </style>